package cn.wolfcode.wms.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.Map;

public abstract class JsonUtil {

    private static ObjectMapper mapper = new ObjectMapper();

    //JSON转换工具
    public static String toJsonString(Object obj){

        try {

            return mapper.writeValueAsString(obj);

        } catch (Exception e) {

            throw new RuntimeException(e);
        }

    }
}
